<%--
  Created by IntelliJ IDEA.
  User: 岳冉
  Date: 2020/5/16
  Time: 16:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%String path = request.getContextPath();%>
<jsp:include page="../inc/header.jsp"></jsp:include>
<!-- Page Heading Section Start -->
<div class="page-heading-section section bg-parallax" data-bg-image="<%=path%>/assets/images/bg/bg-1.jpg" data-overlay="50">
    <div class="container">
        <div class="page-heading-content text-center">
            <h3 class="title">${companyPosition.name}</h3>
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="${pageContext.request.contextPath}/web/index">首页</a></li>
                <li class="breadcrumb-item"><a href="${pageContext.request.contextPath}/web/job/list">工作</a></li>
                <li class="breadcrumb-item active">${companyPosition.name}</li>
            </ol>
        </div>
    </div>
</div>
<!-- Page Heading Section End -->
<!-- Recent Jobs Start -->
<div class="section section-padding">
    <div class="container">
        <div class="row mb-n5">

            <!-- Job List Details Start -->
            <div class="col-lg-8 col-12 mb-5 pr-lg-5">
                <div class="job-list-details">
                    <div class="job-details-head row mx-0">
                        <div class="company-logo col-auto">
                            <a href="company-single.html"><img src="${pageContext.request.contextPath}/assets/images/companies/company-1.png" alt="Company Logo"></a>
                        </div>
                        <div class="salary-type col-auto order-sm-3">
                            <span class="salary-range">$${companyPosition.salaryMin} - ${companyPosition.salaryMax}</span>
                            <span class="badge badge-success">${companyPosition.positionAttr.attr}</span>
                        </div>
                        <div class="content col">
                            <h5 class="title">职位名称：${companyPosition.name}</h5>
                            <ul class="meta">
                                <li><strong class="text-primary"><a href="<%=path%>/web/company/companyInfo?companyId=${companyPosition.company.id}">${companyPosition.company.companyName}</a></strong></li>
                                <li><i class="fa fa-map-marker"></i> 2020 ${companyPosition.city.cityName} , ${companyPosition.company.address}</li>
                            </ul>
                        </div>
                    </div>
                    <div class="job-details-body">
                        <h6 class="mb-3">职位描述</h6>
                        <p>${companyPosition.positionDescription}</p>
                        <p>${companyPosition.positionDescription}</p>
                        <h6 class="mb-3 mt-4">职位要求</h6>
                        <ul>
                            <li>${companyPosition.skillRequest}</li>
                            <li>经验丰富的网页设计师</li>
                            <li>出色的图形设计技巧和强大的产品组合</li>
                            <li>精通HTML，CSS和JavaScript以进行快速原型制作</li>
                            <li>有在敏捷/ Scrum开发过程中工作的经验</li>
                            <li>经验丰富的网页设计师</li>
                            <li>出色的视觉设计技巧，对用户系统交互敏感</li>
                            <li>创造性地，有效地解决问题的能力</li>
                            <li>最新的Web趋势，技术和技术</li>
                            <li>人机交互，交互设计或视觉艺术专业的BS / MS</li>
                        </ul>
                        <h6 class="mb-3 mt-4">教育 + 经验</h6>
                        <ul>
                            <li>${companyPosition.educationalBackgroundType.educationalBackgroundTypeName}</li>
                            <li>${companyPosition.workTime.workExpTime}</li>
                            <li>熟悉移动和网络应用程序者优先</li>
                            <li>电子商务网站设计经验</li>
                            <li>优秀的沟通能力，最显着的能力是征集和解决创意和设计反馈</li>
                            <li>必须能够承受压力并按时完成工作，同时保持积极的态度并提供出色的客户服务</li>
                            <li>能够独立工作并在给定的指令，规定的例行程序和标准的接受惯例的参数范围内完成任务</li>
                        </ul>
                        <h6 class="mb-3 mt-4">待遇</h6>
                        <ul>
                            <li>医疗保险</li>
                            <li>牙科保险</li>
                            <li>视力保险</li>
                            <li>补充福利（短期残疾，癌症和意外事故）</li>
                            <li>雇主赞助的基本生活和发展保险</li>
                            <li>雇主赞助的长期残疾保险</li>
                            <li>401（k）具有匹配</li>
                        </ul>
                    </div>
                </div>
            </div>
            <!-- Job List Details End -->

            <!-- Job Sidebar Wrap Start -->
            <div class="col-lg-4 col-12 mb-5">
                <div class="sidebar-wrap">
                    <!-- Sidebar (Apply Buttons) Start -->
                    <div class="sidebar-widget">
                        <div class="inner">
                            <div class="row m-n2">
                                <div class="col-xl-auto col-lg-12 col-sm-auto col-12 p-2">
                                    <c:if test="${collection eq null}">
                                        <a id="collectJob" class="d-block btn btn-outline-secondary"><i class="fa fa-heart-o mr-1"></i> 收藏工作</a>
                                    </c:if>
                                    <c:if test="${collection ne null}">
                                        <a id="collectJob" class="d-block btn btn-outline-secondary"><i class="fa fa-heart mr-1"></i> 取消收藏</a>
                                    </c:if>
                                </div>
                                <div class="col-xl-auto col-lg-12 col-sm-auto col-12 p-2">
                                    <a id="askJob" class="d-block btn btn-primary"><font color="white">申请工作</font></a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- Sidebar (Apply Buttons) End -->

                    <!-- Sidebar (Job Overview) Start -->
                    <div class="sidebar-widget">
                        <div class="inner">
                            <h6 class="title">工作概述</h6>
                            <ul class="job-overview list-unstyled">
                                <c:if test="${companyAuthc.isPass eq true}">
                                    <li><strong>公司审核:</strong>  <font color="#7cfc00">已通过</font></li>
                                </c:if>
                                <c:if test="${companyAuthc.isPass ne true}">
                                    <li><strong>公司审核:</strong>  <font color="red">未通过</font></li>
                                </c:if>
                                <li><strong>发表于:</strong>  2020年2月15日</li>
                                <li><strong>招聘人数:</strong> 15</li>
                                <li><strong>工作状态:</strong> ${companyPosition.positionAttr.attr}</li>
                                <li><strong>工作经验:</strong> ${companyPosition.workTime.workExpTime}</li>
                                <li><strong>工作地点:</strong> ${companyPosition.city.cityName}</li>
                                <li><strong>薪资:</strong> $${companyPosition.salaryMin} - $${companyPosition.salaryMax}</li>
                                <li><strong>性别要求:</strong> 不限 </li>
                                <li><strong>申请截止日期:</strong> 2020年6月15日</li>
                            </ul>
                        </div>
                    </div>
                    <!-- Sidebar (Job Overview) End -->

                </div>
            </div>
            <!-- Job Sidebar Wrap End -->

        </div>
    </div>
</div>
<!-- Recent Jobs End -->
<script type="text/javascript" src="<%=path%>/assets/js/vendor/jquery-3.4.1.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#collectJob").click(function () {
            var id = ${companyPosition.id};
            if(${sessionScope.person eq null}){
                alert("请先登录");
                return;
            }
            if(${collection eq null}){
                $.ajax({
                    url:"<%=path%>/web/job/collectJob",
                    data:"id="+id,
                    async:false,
                    success:function (mes) {
                        if(mes=='1'){
                            $("#collectJob").html("<i class=\"fa fa-heart mr-1\"></i> 取消收藏");
                        }
                    }
                });
            }
            else {
                $.ajax({
                    url:"<%=path%>/web/job/uncollectJob",
                    data:"id="+id,
                    async:false,
                    success:function (mes) {
                        if(mes=='1'){
                            $("#collectJob").html("<i class=\"fa fa-heart-o mr-1\"></i> 收藏工作");
                        }
                    }
                });
            }

        });
        $("#askJob").click(function () {
            var id = ${companyPosition.id};
            if(${sessionScope.person eq null}){
                alert("请先登录");
                return;
            }
            var sign = 0;
            $.ajax({
                url:"<%=path%>/web/job/check",
                data:"id="+id,
                async:false,
                success:function (mes) {
                    if(mes=='1'){
                        alert("您已经申请过该岗位或未填写简历");
                        sign = 1;
                    }
                }
            });
            if(sign==1){
                return;
            }
            $.ajax({
                url:"<%=path%>/web/job/ask",
                data:"id="+id,
                success:function (mes) {
                    if(mes=='1'){
                        alert("申请成功");
                    }
                    else{
                        alert("申请失败");
                    }
                }
            });
        });
    });
</script>
<jsp:include page="../inc/footer.jsp"></jsp:include>
